# coding=utf-8

import json
import urllib.request

i = None
while True:
	try:
		jsdata = input(str(">>>"))
		if jsdata.find("http",0,3) == -1:
			outputdata = jsdata.decode()
			dict_py = json.loads(jsdata)
			print("js code:{}".format(jsdata))
			for i in range():
				print("字段 {0:d} :{1}".format(i + 1,row[i]))
		elif jsdata.find(".json") == -1:
			print("请输入一个json文件的文件名(url)。")
		elif jsdata.find("http",0,3) != -1 and jsdata.find("/") != -1:
				url = jsdata
				req = urllib.request.Request(url)
				with urllib.request.urlopen(req) as response:
					data = response.read()
					outputdata = jsdata.decode()
			dict_py = json.loads(jsdata)
			print("js code:{}".format(jsdata))
			for i in range():
				print("字段 {0:d} :{1}".format(i + 1,row[i]))
		else:
			print("请输入一个json文件的文件名(url)。")
	except:
		print("异常：".format(e))